#include <stdio.h>

#define NUM 10

struct Student {
    int id;
    char name[20];
    int scores[3];
};
double calculateAverage(struct Student student) {
    double total = 0;
    for(int i = 0; i < 3; i++) {
        total += student.scores[i];
    }
    return total / 3;
}

int main() {
    struct Student students[NUM];


    for(int i = 0; i < NUM; i++) {
        printf("Enter data for student %d:\n", i+1);
        scanf("%d %s", &students[i].id, students[i].name);
        for(int j = 0; j < 3; j++) {
            scanf("%d", &students[i].scores[j]);
        }
    }

    double maxAverage = -1;
    struct Student highestStudent;
    for(int i = 0; i <NUM; i++) {
        double average = calculateAverage(students[i]);
        if(average > maxAverage) {
            maxAverage = average;
            highestStudent = students[i];
        }
    }
    for(int i = 0; i < NUM; i++) {
        printf("Student %d: Average = %.2f\n", students[i].id, calculateAverage(students[i]));
    }
    printf("\n Highest average score student:\n");
    printf("ID: %d, Name: %s, Scores: ", highestStudent.id, highestStudent.name);
    for(int i = 0; i < 3; i++) {
        printf("%d ", highestStudent.scores[i]);
    }
    printf(", Average: %.2f\n", maxAverage);

    return 0;
}
